package com.test.sap;

import java.util.Properties;

import com.sap.conn.jco.ext.DestinationDataEventListener;
import com.sap.conn.jco.ext.DestinationDataProvider;

public class MyDestinationDataProvider implements DestinationDataProvider {
	static String SAP_SERVER = "SAP_SERVER";
	private final Properties ABAP_AS_properties;

	public MyDestinationDataProvider() {
		Properties properties = new Properties();
		/*
		server=/
				SAPsid=PTP
				SAPmaxcons=20
				SAPclient=200
				SAPuserid=papps_if
				SAPpasswd=papps_if123
				SAPlang=EN
				SAPmshost=61.111.129.63
				SAPsysno=00
				SAPGROUP=PT_LOGON_GRP
		*/
		
		properties.setProperty(DestinationDataProvider.JCO_ASHOST, "61.111.129.63");
		properties.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
		properties.setProperty(DestinationDataProvider.JCO_CLIENT, "200");
		properties.setProperty(DestinationDataProvider.JCO_USER, "papps_if");
		properties.setProperty(DestinationDataProvider.JCO_PASSWD, "papps_if123");
		properties.setProperty(DestinationDataProvider.JCO_LANG, "EN");
		//properties.setProperty(DestinationDataProvider.JCO_GROUP, "PT_LOGON_GRP");
		//properties.setProperty("jco.client.r3name", "PTD");
		//properties.setProperty("jco.client.mshost", "61.111.129.63");

		ABAP_AS_properties = properties;
	}

	@Override
	public Properties getDestinationProperties(String system) {
		return ABAP_AS_properties;
	}

	@Override
	public void setDestinationDataEventListener(
			DestinationDataEventListener eventListener) {
	}

	@Override
	public boolean supportsEvents() {
		return false;
	}
}
